package com.iotechn.unimall.app.api.integralactivity;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.IntegralTaskDO;
import com.iotechn.unimall.data.mapper.IntegralTaskMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by rize on 2019/7/14.
 */
@Service
public class TaskIntegralServiceImpl implements TaskIntegralService {

    @Autowired
    private IntegralTaskMapper integralTaskMapper;

    /**
     * 获取任务列表
     * @param userId
     * @return
     * @throws ServiceException
     */
    public List<IntegralTaskDO> taskList(Long userId) throws ServiceException{
        Wrapper<IntegralTaskDO> wrapper = new EntityWrapper<IntegralTaskDO>();
        wrapper.eq("status", 1);
        List<IntegralTaskDO> integralGoodsDOS = integralTaskMapper.selectList(wrapper);
        return integralGoodsDOS;
    }

}
